<!doctype html>
<!-- <html class="no-js" lang=""> -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<script src="/js/jquery-2.1.1.js"></script>
<script>
	//每1秒执行一次myFunction()方法
	$(document).ready(function() {
		window.setInterval(myFunction, 1000);
	});

	function myFunction() {
		console.log("ticket:" + $("#ticket").val());
		htmlobj = $.ajax({
			url : "/Order/query_result",
			type : "GET",
			data : {
				ticket : $("#ticket").val(),
			},
			cache : false,
			async : false,
			success : function(data) {
				console.log("data: "+data);
				if (data == "ok") {
					alert("恭喜你！抢购成功了！");
					self.location='/list';
										
				} else if(data != null && data!="") {
					alert(data);
				}

			},
			error : function(err) {
				alert(err);
			}
		});		
	}
</script>

</head>
<body>
	<a
		th:text="${'您的抢购申请已经被接受，请耐心等候处理结果.抢购商品编号：'+goodsid+',ticket='+ ticket}"></a>
	<input id="ticket" type="hidden" th:value="${ticket}" />

</body>
</html>
